<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:fb="http://www.facebook.com/2008/fbml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/template/kiwi/template_1col.xhtml">

<ui:define name="script">

    <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/#{locale.language}_#{locale.country}" type="text/javascript"></script>
    
    <script type="text/javascript">
    function facebook_onlogin() {
        FB.Connect.ifUserConnected("fblogin/loginFB.seam?cid=#{conversation.id}");
    }
    </script>

</ui:define>

<ui:define name="stylesheet">
    <link rel="stylesheet" type="text/css" href="stylesheet/kiwi/elements/login.css" />
</ui:define>

<ui:define name="center">
	<div class="box">
	<p:messages id="msgs" showDetail="false"/>

	<h:form id="formLogin">
        <center>
        	<p:panel header="Please login here:" style="width:400px;">
				<div class="dialog">
				  <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value">
					<h:outputLabel for="username">#{messages['login.username']}</h:outputLabel>
					<h:inputText id="username" value="#{loginAction.login}" />
					<h:outputLabel for="password">#{messages['login.password']}</h:outputLabel>
					<h:inputSecret id="password" value="#{loginAction.password}" />
					<h:outputLabel for="rememberMe">#{messages['login.remember']}</h:outputLabel>
					<h:selectBooleanCheckbox id="rememberMe" value="#{rememberMe.enabled}" />
				  </h:panelGrid>
				</div>
				
		
		        <div class="registerText">#{messages['login.registered']}<h:outputText value=" " /><s:link view="/register.xhtml" value="#{messages['login.register']}"/></div>
				<div class="actionButtons">
				  <p:commandButton value="#{messages['login.btn_login']}" action="#{loginAction.login}" ajax="false"/>
				</div>
				
				<f:facet name="footer">
					<s:div styleClass="alternative-login">
						<img src="img/facebook-logo-small.png" />
						<a href="login.xhtml#" onclick="FB.Connect.requireSession(facebook_onlogin); return false;">#{messages['login.facebook']}</a>.
                        <br />
                        <img src="img/foaf-logo-small.png" />
                        <s:link view="/foaflogin/loginFOAFSSL.xhtml" value="#{messages['login.foaf']}"/>.
           			</s:div>
				</f:facet>
			</p:panel>

	    </center>
	    
    </h:form>

    <script type="text/javascript">
        FB.init("@facebook.key@", "fbconnect/xd_receiver.htm");
    </script>
    </div>

</ui:define> 
</ui:composition>
